home *** CD-ROM | disk | FTP | other *** search
-
-
-
- SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrSSSSeeeettttttttiiiinnnnggggssss((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrSSSSeeeettttttttiiiinnnnggggssss((((3333))))
-
-
-
- NNNNAAAAMMMMEEEE
- SLGetPrinterSettings, SLSysVGetSpoolerOptions, SLSysVGetPrinterOptions,
- SLSysVSaveSpoolerOptions, SLSysVSavePrinterOptions - option management
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssppppoooooooollll....hhhh>>>>
-
- iiiinnnntttt SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrSSSSeeeettttttttiiiinnnnggggssss((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****pppprrrriiiinnnntttteeeerrrr,,,,
- SSSSLLLLSSSSeeeettttttttiiiinnnnggggssssSSSSttttrrrruuuucccctttt ********sssseeeettttttttiiiinnnnggggsssspppp))));;;;
-
- iiiinnnntttt SSSSLLLLSSSSyyyyssssVVVVGGGGeeeettttSSSSppppoooooooolllleeeerrrrOOOOppppttttiiiioooonnnnssss((((SSSSLLLLSSSSyyyyssssVVVVSSSSppppoooooooolllleeeerrrrOOOOppppttttiiiioooonnnnssssSSSSttttrrrruuuucccctttt
- ********ssssppppoooooooolllleeeerrrr____ooooppppttttsssspppp))));;;;
-
- iiiinnnntttt SSSSLLLLSSSSyyyyssssVVVVGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrOOOOppppttttiiiioooonnnnssss((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****pppprrrriiiinnnntttteeeerrrr,,,,
- cccchhhhaaaarrrr ********pppprrrriiiinnnntttteeeerrrr____ooooppppttttsssspppp))));;;;
-
- iiiinnnntttt SSSSLLLLSSSSyyyyssssVVVVSSSSaaaavvvveeeeSSSSppppoooooooolllleeeerrrrOOOOppppttttiiiioooonnnnssss((((SSSSLLLLSSSSyyyyssssVVVVSSSSppppoooooooolllleeeerrrrOOOOppppttttiiiioooonnnnssssSSSSttttrrrruuuucccctttt
- ****ssssppppoooooooolllleeeerrrr____ooooppppttttssss))));;;;
-
- iiiinnnntttt SSSSLLLLSSSSyyyyssssVVVVSSSSaaaavvvveeeePPPPrrrriiiinnnntttteeeerrrrOOOOppppttttiiiioooonnnnssss((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****pppprrrriiiinnnntttteeeerrrr,,,,
- cccchhhhaaaarrrr ****pppprrrriiiinnnntttteeeerrrr____ooooppppttttssss,,,,
- iiiinnnntttt llllooooccccaaaattttiiiioooonnnn))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The spooling system and the printer provide many options to customize
- their behavior to the needs of the user. The Silicon Graphics printing
- environment permits applications to save and retrieve these printing
- options. For example, a user can select duplex printing for a particular
- printer and save this setting. From then on, whenever a print job is sent
- to that printer it will be printed in duplex mode. This option management
- is provided by the _l_i_b_s_p_o_o_l functions _S_L_G_e_t_P_r_i_n_t_e_r_S_e_t_t_i_n_g_s,
- _S_L_S_y_s_V_G_e_t_S_p_o_o_l_e_r_O_p_t_i_o_n_s, _S_L_S_y_s_V_G_e_t_P_r_i_n_t_e_r_O_p_t_i_o_n_s,
- _S_L_S_y_s_V_S_a_v_e_S_p_o_o_l_e_r_O_p_t_i_o_n_s and _S_L_S_y_s_V_S_a_v_e_P_r_i_n_t_e_r_O_p_t_i_o_n_s.
-
- Currently, option management is supported only under the System V
- spooling system. Under the System V spooler the spooler options are the
- _l_p(_1) command switches ----cccc, ----mmmm, ----wwww, ----ssss and ----tttt. Refer to the _l_p man page
- for an explanation of these switches. Spooler options are maintained on a
- per user basis. For example, a banner page title (-t) is saved for a
- single user. That title will be used for all print jobs submitted by that
- user to any printer. Printer specific options are considered to be those
- that would be specified using the _l_p command line switch ----oooo. Though there
- are often numerous printer specific options, the _l_i_b_s_p_o_o_l option
- management functions treat them together as a single whitespace separated
- string of options. Printer options are maintained on a per user, per
- printer basis. This means that a user can save the option to suppress the
- printing of the banner for a specific printer without that settings
- affecting any other user or printer.
-
- Note that an application must utilize the _l_i_b_s_p_o_o_l functions detailed
- here to participate in spooler and printer option management. For
- example, if an application submits a print job using _S_L_S_u_b_m_i_t_J_o_b, it is
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrSSSSeeeettttttttiiiinnnnggggssss((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrSSSSeeeettttttttiiiinnnnggggssss((((3333))))
-
-
-
- the application's responsibility to use the option management functions
- to determine what option settings should be specified for the print job.
- The _P_r_i_n_t_P_a_n_e_l and _l_p programs utilize the _l_i_b_s_p_o_o_l option management
- facilities. In order to provide a consistent printing environment, it is
- strongly suggested that application developers utilize the _l_i_b_s_p_o_o_l
- option management functions. The goal is to remember user printing
- preferences across applications.
-
- While spooler and printer options are typically handled in a spooling
- system dependent manner, the _S_L_G_e_t_P_r_i_n_t_e_r_S_e_t_t_i_n_g_s reads these settings
- into the spooling system independent option structure _S_L_S_e_t_t_i_n_g_s_S_t_r_u_c_t.
- This function reads both the spooler and printer options. As contained in
- the _S_L_S_e_t_t_i_n_g_s_S_t_r_u_c_t, the settings can be passed as parameters to the
- _l_i_b_s_p_o_o_l print job submittal functions (e.g. _S_L_S_u_b_m_i_t_J_o_b). By using the
- _S_L_G_e_t_P_r_i_n_t_e_r_S_e_t_t_i_n_g_s function, an application can submit a print job
- using options that the submitter has previously saved using SGI's
- printing tools. Thus, the print job will be customized to match the
- preferences of the user.
-
- The _S_L_S_y_s_V_G_e_t_S_p_o_o_l_e_r_O_p_t_i_o_n_s and _S_L_S_y_s_V_S_a_v_e_S_p_o_o_l_e_r_O_p_t_i_o_n_s functions read
- and write System V spooling system options, respectively. These are
- System V spooling system specific functions and an error indication will
- be returned if these functions are called when the System V spooler is
- not the current spooling system. Spooling system specific options are
- saved in the caller's home directory under the name ._g_l_p_r_c. This file
- contains a single line of spooler specific option switches. The switches
- are the same as the spooler specific command line switches used by the _l_p
- program with the exception that the ----dddd, and ----nnnn switches are never saved.
- These functions pass the spooler options in the
- _S_L_S_y_s_V_S_p_o_o_l_e_r_O_p_t_i_o_n_s_S_t_r_u_c_t structure.
-
- The _S_L_S_y_s_V_G_e_t_P_r_i_n_t_e_r_O_p_t_i_o_n_s and _S_L_S_y_s_V_S_a_v_e_P_r_i_n_t_e_r_O_p_t_i_o_n_s functions read
- and write System V printer specific options, respectively. These are
- System V spooling system specific functions and an error indication will
- be returned if these functions are called when the System V spooler is
- not the current spooling system. Printer specific options are saved in
- the directory /_v_a_r/_s_p_o_o_l/_l_p/_s_e_t_t_i_n_g_s/<_p_r_i_n_t_e_r _n_a_m_e>. Each user's option
- file will be named by username. A default option file named
- _d_e_f_a_u_l_t_S_e_t_t_i_n_g_s may be found in the printer settings directory and, if it
- exists, will be used if no user option file is found. The printer
- specific options file consists of a single line of options. The contents
- are all the options specified using the ----oooo command line switch to the _l_p
- command. Printer specific options cannot be saved for printer classes.
-
- _p_r_i_n_t_e_r specifies the name of the printer for which options are to
- be read or written. If NNNNUUUULLLLLLLL, the default printer will be
- used.
-
- _s_e_t_t_i_n_g_s_p is set by the _S_L_G_e_t_P_r_i_n_t_e_r_S_e_t_t_i_n_g_s function to point to an
- _S_L_S_e_t_t_i_n_g_s_S_t_r_u_c_t structure containing the job and printer
- settings information. The contents of this structure must
- be copied to caller storage if they are to be preserved
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrSSSSeeeettttttttiiiinnnnggggssss((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrSSSSeeeettttttttiiiinnnnggggssss((((3333))))
-
-
-
- across subsequent calls to the _S_L_G_e_t_P_r_i_n_t_e_r_S_e_t_t_i_n_g_s
- function. If spooler or printer options cannot be found
- or the specified printer does not exist, the default
- values specified below will be assigned to the
- _S_L_S_e_t_t_i_n_g_s_S_t_r_u_c_t structure fields.
-
- _s_p_o_o_l_e_r__o_p_t_s_p is set by the _S_L_S_y_s_V_G_e_t_S_p_o_o_l_e_r_O_p_t_i_o_n_s function to point to
- an _S_L_S_y_s_V_S_p_o_o_l_e_r_O_p_t_i_o_n_s_S_t_r_u_c_t. This structure contains the
- System V spooler options. The contents of this structure
- must be copied to caller storage if they are to be
- preserved across subsequent calls to the
- _S_L_S_y_s_V_G_e_t_S_p_o_o_l_e_r_O_p_t_i_o_n_s function. If spooler options
- cannot be found, the default values specified below will
- be assigned to the _S_L_S_y_s_V_S_p_o_o_l_e_r_O_p_t_i_o_n_s_S_t_r_u_c_t structure
- fields.
-
- _s_p_o_o_l_e_r__o_p_t_s specifies to the _S_L_S_y_s_V_S_a_v_e_S_p_o_o_l_e_r_O_p_t_i_o_n_s function the
- values of the spooler options to be saved. These values
- are passed in the _S_L_S_y_s_V_S_p_o_o_l_e_r_O_p_t_i_o_n_s_S_t_r_u_c_t structure.
-
- _p_r_i_n_t_e_r__o_p_t_s_p is set by the _S_L_S_y_s_V_G_e_t_P_r_i_n_t_e_r_O_p_t_i_o_n_s function to point to
- a string containing the printer specific options. The
- options within the string are separated by whitespace. If
- no options are found for the specified printer or the
- printer does not exist, this pointer is set to NNNNUUUULLLLLLLL.
-
- _p_r_i_n_t_e_r__o_p_t_s specifies to the _S_L_S_y_s_V_S_a_v_e_P_r_i_n_t_e_r_O_p_t_i_o_n_s function the
- string of printer specific options to be saved.
-
- _l_o_c_a_t_i_o_n specifies to the _S_L_S_y_s_V_S_a_v_e_P_r_i_n_t_e_r_O_p_t_i_o_n_s function whether
- the options to be saved are only for the caller
- (SSSSLLLL____SSSSAAAAVVVVEEEE____UUUUSSSSEEEERRRR) or are for all users of the specified
- printer (SSSSLLLL____SSSSAAAAVVVVEEEE____DDDDEEEEFFFFAAAAUUUULLLLTTTT). Note that to save options for
- all users the caller must have the username _r_o_o_t or _l_p as
- determined from the effective user ID.
-
- The _S_L_S_e_t_t_i_n_g_s_S_t_r_u_c_t is defined as:
-
- typedef struct _slSettingsStruct {
- int copy; /* 1 == copy to spooling dir, 0 == link */
- int mail; /* 1 == send mail on completion */
- char *title; /* Print job banner page title. If NULL */
- /* the system default banner title */
- /* is to be used. */
- char *options; /* Spooling system specific options */
- /* (e.g. -w and -o under System V */
- /* and -h under BSD) */
- } SLSettingsStruct;
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-
-
-
- SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrSSSSeeeettttttttiiiinnnnggggssss((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrSSSSeeeettttttttiiiinnnnggggssss((((3333))))
-
-
-
- The default values for the fields of the _S_L_S_e_t_t_i_n_g_s_S_t_r_u_c_t are spooling
- system dependent and are listed in the following table.
-
- Field Sys V Default BSD Default
- _____________________________________
- copy 0 1
- mail 0 0
- title NULL NULL
- options NULL NULL
-
- The _S_L_S_y_s_V_S_p_o_o_l_e_r_O_p_t_i_o_n_s_S_t_r_u_c_t is defined as:
-
- typedef struct _slSysVSpoolerOptionsStruct {
- int copy; /* 1 == copy to spooling dir, 0 == link */
- int mail; /* 1 == send mail on completion */
- int message; /* 1 == send message on completion */
- int suppress_id; /* 1 == suppress job ID message */
- char *title; /* Print job banner page title. If NULL */
- /* the system default banner title */
- /* is to be used. */
- } SLSysVSpoolerOptionsStruct;
-
-
- The default values for the fields of the _S_L_S_y_s_V_S_p_o_o_l_e_r_O_p_t_i_o_n_s_S_t_r_u_c_t are
- listed in the following table.
-
- Field Sys V Default
- ___________________________
- copy 0
- mail 0
- message 0
- suppress_id 0
- title NULL
-
- RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
- All functions return 0 if execution was successful. -1 is returned and
- _S_L_e_r_r_n_o is set if an execution error has occurred.
-
- EEEEXXXXEEEECCCCUUUUTTTTIIIIOOOONNNN EEEERRRRRRRROOOORRRR CCCCOOOODDDDEEEESSSS
- All functions will fail under the following circumstances.
-
- SL_ERR_FIND_SPOOLER An error occurred while attempting to determine
- the available printer spooling systems.
-
- SL_ERR_NO_SPOOLERS There are no printer spooling systems available.
-
-
- SL_ERR_NO_DEF_PRINTER There is no default printer registered with the
- printer spooling system.
-
-
-
-
-
-
- PPPPaaaaggggeeee 4444
-
-
-
-
-
-
- SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrSSSSeeeettttttttiiiinnnnggggssss((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrSSSSeeeettttttttiiiinnnnggggssss((((3333))))
-
-
-
- SL_ERR_BAD_PRINTER_NAME The printer name specified is either an empty
- string (""), or a string consisting entirely of
- whitespace.
-
- In addition, the _S_L_S_y_s_V... functions will fail under the following
- circumstances.
-
- SL_ERR_NO_SYSV This function requires that the System V spooler
- be the current spooling system.
-
- And the _S_L_S_y_s_V_S_a_v_e... functions can fail for the following reason.
-
- SL_ERR_SAVE_OPTIONS The options file could not be saved. Check the
- value of errno.
-
- WWWWAAAARRRRNNNNIIIINNNNGGGG
- The pointers to _s_e_t_t_i_n_g_s_p, _s_p_o_o_l_e_r__o_p_t_s_p, and _p_r_i_n_t_e_r__o_p_t_s_p are invalid
- across subsequent calls to their functions. The data pointed to must be
- copied to be preserved. Note that the character string fields of the
- structures must be duplicated in any copy operation since these pointers
- also become invalid.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- glp(1), lp(1), SLPerror(3), libspool(3)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 5555
-
-
-
-